import com.zeng.pojo.Cat;
import com.zeng.pojo.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author zeng
 * @data 2021/06/06 15:47
 */
public class Mytest {

    //public static void main(String[] args) {
    //    ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
    //    User user = context.getBean("user", User.class);
    //    System.out.println(user.getUser());
    //    //User user1 = (User) context.getBean("userT");
    //}

    @Test
    public void CatDemo(){
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        Cat cat = (Cat)context.getBean("cat");
        System.out.println(cat.toString());
    }
    @Test
    public void TestDemo(){
        ApplicationContext context = new AnnotationConfigApplicationContext(Cat.class);
        context.getBean("toString");
    }
}
